<?php

include('includes/basic.php');

$phase=$_POST['phase'];
$desc=addslashes($_POST['phase_desc']);
$user=$_SESSION['uid'];
	$s="select * from phase_master where phase_type=".$phase;
	$s_query=mysql_query($s);

		if(mysql_num_rows($s_query)>0)
		{
			echo "already exists";
		}
			else
			{

			$sql=mysql_query("insert into phase_master(`phase`,`phase_desc`) values ('$phase','$desc')");
			
			}
	if($sql)
	{
	 header("location:addphase.php");
	}
ob_flush();
?>